/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.fasepa.sgpf.factoryDAO;

import java.util.List;

/**
 *
 * @author marcosdj
 * @param <R>
 */
public class GenericRN<R> implements InterfaceRN<R>{

    GenericDAO<R> dao = new GenericDAO<>();

    
    @Override
    public boolean save(R o) {
        return dao.criar(o);
    }

    @Override
    public boolean edit(R o) {
        return dao.alterar(o);
    }

    @Override
    public boolean delete(R o) {
        return dao.excluir(o);
    }
    
    @Override
    public R obtain(Class<R> classe, Object id) {
        return dao.obter(classe, id);
    }

    @Override
    public List<R> obtainAll(Class<R> classe) {
        return dao.obterTodos(classe);
    }

}
